package com.chb.flyweight;

/**
 * @author chihb
 * @create-time 2024/10/24 15:09
 * @description
 */
public class PieceFactory {
    private Piece[] pieces={new BlackPiece(),new WhitePiece()};
    public Piece getPiece(int index){
        if(index==0) return pieces[0];
        return pieces[1];
    }
}
